//
//  YuYueSuccessViewController.m
//  FD
//
//  Created by xiaofang wang on 2018/11/8.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "YuYueSuccessViewController.h"
#import "YuYueShangPinLeiMuViewController.h"

//往预 “门店商品类目” 页面跳转
@interface YuYueSuccessViewController ()
@property (weak, nonatomic) IBOutlet UILabel *myYuYueNumLb; /**我的预约号*/
/**xxxxx提示文字*/
@property (weak, nonatomic) IBOutlet UILabel *tipsLb;
/**预约点餐按钮*/
@property (weak, nonatomic) IBOutlet UIButton *yuyueBtn;
@property (weak, nonatomic) IBOutlet UILabel *numberLb;

@end

@implementation YuYueSuccessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    //NSNumber类型
    self.numberLb.text = [NSString stringWithFormat:@"%@",self.successDic[@"number"]]; //显示预约号
 
    [self __international]; //国际化
}

/**国际化*/
- (void)__international {
    NSString *successStr = NSLocalizedString(Home_YuYueSuccess, @"预约成功");
    NSString *yuyueNumStr = NSLocalizedString(Home_YuYue_MyYuYueHao, @"我的预约号");
    NSString *tipsStr = NSLocalizedString(Home_YuYue_Reservation_prompting, @"为方便你用餐xxxxx");
    
//    NSString *yuyueStr = NSLocalizedString(Home_YuYueDianCan, @"预约点餐");
    NSString *yuyueStr = NSLocalizedString(Home_YuYueDianCan_OrderNow, @"预约点餐新2019-2-22");
    
    
    self.navigationItem.title = successStr;
    self.myYuYueNumLb.text = yuyueNumStr;
    self.tipsLb.text = tipsStr;
    [self.yuyueBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    [self.yuyueBtn setTitle:yuyueStr forState:(UIControlStateNormal)];
}
- (IBAction)clickYuYueBtnAction:(UIButton *)sender {
    
    NSNumber *yuyueId = self.successDic[@"id"]; //Number类型
    if ([NSString isEmptyString:[NSString stringWithFormat:@"%@",yuyueId]]) {
        FDLog(@"预约ID为空无法跳转:%@",yuyueId);
        return;
    }

    YuYueShangPinLeiMuViewController *yuyueVC = [[YuYueShangPinLeiMuViewController alloc] init];
    yuyueVC.yuyueId1 = yuyueId; //传递预约id一次
    [self.navigationController pushViewController:yuyueVC animated:YES];
}
@end
